package com.blb.day20231107login.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.blb.day20231107login.entity.Permission;
import com.blb.day20231107login.entity.Role;
import com.blb.day20231107login.mapper.PermissionMapper;
import com.blb.day20231107login.mapper.RoleMapper;
import com.blb.day20231107login.service.IPermissionService;
import com.blb.day20231107login.service.IRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenheng
 * @since 2023-11-06
 */
@Service
public class PermissionServiceImpl extends ServiceImpl<PermissionMapper, Permission> implements IPermissionService {

    @Autowired
    private PermissionMapper permissionMapper;

    @Override
    public List<Permission> getPermissionWithChildren() {
        return permissionMapper.selectPermissionsWithChildren();
    }

    @Override
    public List<Long> getselectPermissionIdsByRoleId(Long roleId) {
        return permissionMapper.selectPermissionIdsByRoleId(roleId);
    }
}
